//@author A0101032L
#ifndef UI_H
#define UI_H



#include <iostream>
#include <Windows.h>
#include <assert.h>
#include "Logic.h"

using namespace std;
//using namespace System;

static const string MESSAGE_WELCOME = "Welcome To ToDoIter!";
static const string MESSAGE_TASKS_TODAY = "\nThe tasks for today are as follows:\n";
static const string MESSAGE_NO_TASKS_TODAY = "\nThere are no tasks scheduled today.\n";
static const string MESSAGE_GOODBYE = "GoodBye! Thanks for Using TodoIter";
static const string MESSAGE_COMMAND = "Command: ";
static const string COMMAND_EXIT = "exit";
static const string COMMAND_DISPLAY_TASK_TODAY = "display today";
static const string COMMAND_HELP = "Please press help for more details.";
static const string COMMAND_POSSIBLE_INPUT = "Posssible commands are: \n \"add\"\n \"delete\"\n \"search\"\n \"rename\"\n \"reschedule\"\n \"relocate\"\n \"display\"\n \"clear\"\n \"exit\"";

	
// SUCCESS_SAVE,	
//SUCCESS_LOAD,

static const string MESSAGE_SUCCESS_ADD = "Task has been successfully added.";
static const string MESSAGE_SUCCESS_REMOVE = "Task has been succesfully removed.";
static const string MESSAGE_SUCCESS_DISPLAY = "Tasks have been successfully displayed.";
static const string MESSAGE_SUCCESS_MARK = "Task has been marked as done.";
static const string MESSAGE_SUCCESS_UNMARK = "Task has been marked as undone.";
static const string MESSAGE_SUCCESS_SEARCH_EMPTY_SLOTS = "Empty slots in the range have been displayed.";
static const string MESSAGE_SUCCESS_SEARCH_RANGE = "Tasks in the range have been found and displayed.";
static const string MESSAGE_SUCCESS_SEARCH = "Tasks have been found and displayed. ";
static const string MESSAGE_SUCCESS_UNDO = "Undo Successful.";
static const string MESSAGE_SUCCESS_REDO = "Redo Successful.";
static const string MESSAGE_SUCCESS_HELP = "Help has been displayed.";
static const string MESSAGE_SUCCESS_RENAME = "Task has been renamed.";
static const string MESSAGE_SUCCESS_RESCHEDULE = "Task has been rescheduled.";
static const string MESSAGE_SUCCESS_RELOCATE = "Task has been relocated.";
static const string MESSAGE_SUCCESS_CLEAR = "All tasks have been successfully cleared.";



static const string MESSAGE_ERROR_ADD = "Wrong input entered.";
static const string MESSAGE_ERROR_ADD_DUPLICATE = "Sorry, there is currently a task with the same name.";
static const string MESSAGE_ERROR_REMOVE = "There was an error while deleting.";
static const string MESSAGE_ERROR_DISPLAY = "There was an error while displaying.";
static const string MESSAGE_ERROR_MARK = "The task was not found.";
static const string MESSAGE_ERROR_UNMARK = "The task was not found.";
static const string MESSAGE_ERROR_SEARCH = "The task was not found."; 
static const string MESSAGE_ERROR_UNDO = "There was an error while trying to undo the command.";
static const string MESSAGE_ERROR_REDO = "There was an error while trying to redo the command.";
static const string MESSAGE_ERROR_CLEAR = "There was an error while trying to clear the tasks.";
static const string MESSAGE_ERROR_EMPTY_INPUT = "No input entered. Please enter valid command.";
static const string MESSAGE_ERROR_INTERPRETER_FORMAT= "The input format is incorrect.";
static const string MESSAGE_ERROR_INTERPRETER_DATETIME_FORMAT = "The date time format entered is incorrect";
static const string MESSAGE_ERROR_INTERPRETER_START_TIME_BUT_NO_END_TIME = "Please specify a valid end time.";
static const string MESSAGE_ERROR_INTERPRETER_ENDTIME_BEFORE_STARTTIME = "The start time entered is after the end time. Hint: Did you forget to specify the end date?";
static const string MESSAGE_ERROR_INTERPRETER_DATETIME_INVALID = "The date/time entered is invalid, ";
static const string MESSAGE_ERROR_RENAME = "The task was not found.";
static const string MESSAGE_ERROR_RENAME_NO_NEW_NAME = "Please specify a valid new name.";
static const string MESSAGE_ERROR_RESCHEDULE = "The task was not found.";
static const string MESSAGE_ERROR_RELOCATE = "The task was not found.";
static const string MESSAGE_ERROR_INTERPRETER_PARAMETER_OVERLOAD_TIME = "Too many parameters detected for date/time. Did you use multiple from/to/on statements in your command? Type help time for more details.";
static const string MESSAGE_ERROR_SEARCH_TIME_EMPTY = "Please specify a valid start and end time. ";

	
	
static const string MESSAGE_WARNING_DISPLAY_NO_RESULT = "There are no tasks to be displayed.";
static const string MESSAGE_WARNING_MARK_NO_CHANGE = "Task does not exist or has previously been marked done.";
static const string MESSAGE_WARNING_UNMARK_NO_CHANGE = "Task does not exist or is already unmarked.";
static const string MESSAGE_WARNING_SEARCH_NO_RESULT = "Search has resulted in no matches.";
static const string MESSAGE_WARNING_SEARCH_NO_SLOTS = "There are no slots for the prefered timing.";
static const string MESSAGE_WARNING_UNDO_NO_COMMAND = "There are no commands to undo.";
static const string MESSAGE_WARNING_REDO_NO_COMMAND = "There are no commands to redo.";
static const string MESSAGE_WARNING_WRONG_INPUT = "The input is incorrect.";
static const string MESSAGE_WARNING_RENAME_CLASH = "The task name is already in use.";
static const string MESSAGE_WARNING_DISPLAY_TASK = "No such task to display. You have the following tasks in the system: ";
static const string MESSAGE_WARNING_CLEAR = "This process erases all information and cannot be undone. \nIf you still wish to proceed retype the same command again or else type another valid command.";




class UI
{
private:
	Logic _logic;
	/*
	* Purpose:
	* It will display a welcome message to the user
	* It will also display the tasks of the day
	*/
	void displayWelcomeMessage(HANDLE hConsole);
	/*
	* Purpose:
	* It takes in the user command and puts it as a string
	*/
	void displayCommandMessage(string& command, HANDLE hConsole);
	/*
	* Purpose:
	* Send the user's command to the Logic
	*/
	void displayProcessorMessage(string command,HANDLE hConsole,bool& statusFlag);
	/* Purpose: 
	To display error messages
	*/
	void error(int code, HANDLE hConsole);
	/* Purpose: 
	To display success messages
	*/
	void success(int code, HANDLE hConsole);

	/* 
	Purpose: 
	To display warning messages
	*/
	void warning(int code, HANDLE hConsole );

	/*
	Purpose:
	To set the color of the text
	*/
	void SetColor(int value);




	
public:
	/*
	* Purpose:
	* It will be called when the program is started up
	* Will take in user input and pass it to Processor
	* Checks if the user decides to exit To-do Iter
	*/
	void UI_interface(); 
};

#endif
